class CreateSqlOrders < ActiveRecord::Migration
  def change
    create_table :sql_orders do |t|
      t.references :user, index: true
      t.string :title
      t.references :database, index: true
      t.text :sql_script
      t.integer :exec_queue
      t.datetime :exec_time
      t.datetime :fin_time
      t.string :status

      t.timestamps
    end
    add_index :sql_orders, :status
  end
end
